#include<iostream>
#include<math.h>
#include<string>

using std::cout;
using std::endl;
using std::string;

class Point
{
public:
    Point(int a ,int b)
        :_x(a)
         ,_y(b)
    {}
friend    class Line;
private:
    int _x;
    int _y;
};
class Line
{
public:
    Line(int a,int b, int c,int d);
    float length();
private:
    Point _start;
    Point _end;
};
Line::Line(int a,int b, int c,int d)
        :_start(a,b)
         ,_end(c,d)
    {}
    float Line::length()
    {
        return sqrtf(powf((_start._x-_end._x),2)+powf((_start._y-_end._y),2)) ;
    }

class Color
{
public:
    Color(string& color)
        :_color(color)
    {}
    string& getcolor()
    {
        return _color;
    }
private:
    std::string _color;
};
class Triangle
:public Color
,public Line
{
public:
    Triangle(int a ,int b, int c, int d,string color,float height)
        :Color(color)
         ,Line(a,b,c,d)
         ,_height(height)
    {}

    string& getcolor()
    {
        return Color::getcolor();
    }

    float getarea()
    {
        return _height*Line::length();
    }

    float Getperimeter()
    {
        float length=Line::length();
        return _height+length+sqrt(powf(_height,2)+powf(length,2));
    }

private:
    float _height;
};

int main(void)
{
    Triangle test(0,0,4,0,"green",3);
    cout<<"area "<<test.getarea()<<endl
        <<"color "<<test.getcolor()<<endl
        <<"perimeter "<<test.Getperimeter()<<endl;
}

